﻿<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true"
    CodeFile="Po.aspx.cs" Inherits="Admin_Po" Title="Po List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    Po List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1"
        PersistenceMethod="Session" />
    <br />
    <data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
        DataSourceID="PoDataSource" DataKeyNames="PoId" AllowMultiColumnSorting="False" 
        DefaultSortColumnName="PoId" DefaultSortDirection="Descending" 
        ExcelExportFileName="Export_Po.xls" AllowExportToExcel="True" 
        AllowPaging="True" AllowSorting="True" ExportToExcelText="Excel" 
        PageSelectorPageSizeInterval="10" RecordsCount="0" 
        ShowGridOnEmptyData="False" onrowcommand="GridView1_RowCommand">
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="PoId" HeaderText="Po Id" SortExpression="[POId]" ReadOnly="True" />
            <asp:BoundField DataField="PoDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Po Date"
                SortExpression="[PODate]" />
            <asp:BoundField DataField="DeliveryTo" HeaderText="Delivery To" SortExpression="[DeliveryTo]" />
            <asp:BoundField DataField="Remark" HeaderText="Remark" SortExpression="[Remark]" />
            <asp:BoundField DataField="RequestBy" HeaderText="Request By" SortExpression="[RequestBy]"/>
            <data:BoundRadioButtonField DataField="IsComplete" HeaderText="Is Complete" SortExpression="[IsComplete]" />
             <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="btn_Delete" runat="server" CommandName="CustomDelete" CommandArgument='<%#Eval("PoId") %>'
                        Enabled='<%#!(Boolean)Eval("IsComplete")%>' ImageUrl="~/Admin/resources/images/icons/cross_circle.png"
                        OnClientClick="return confirm('Are you sure want to delete?');" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <b>No Po Found!</b>
        </EmptyDataTemplate>
    </data:EntityGridView>
    <br />
    <asp:Button runat="server" ID="btnPo" OnClientClick="javascript:location.href='PoEdit.aspx'; return false;"
        Text="Add New" CssClass="button"></asp:Button>
    <data:PoDataSource ID="PoDataSource" runat="server" SelectMethod="GetPaged" EnablePaging="True"
        EnableSorting="True" EnableDeepLoad="True">
        <DeepLoadProperties Method="IncludeChildren" Recursive="False">
            <Types>
                <data:PoProperty Name="WebUser" />
            </Types>
        </DeepLoadProperties>
        <Parameters>
            <data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
            <data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:PoDataSource>
</asp:Content>
